﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

#include "RpcSharedObject.h"
#include "UniIdentity.h"
#include "OwnerPtr.h"
#include "Matrix4d.h"
#include "Vector3d.h"

namespace gcmp
{
    // 编辑族共享数据
    class GM_INPLACE_EDIT_EXPORT EditFamilySharedContent : public RpcSharedObject
    {
        DBOBJECT_DATA_BEGIN(gcmp, EditFamilySharedContent, gcmp::RpcSharedObject, A49A6F25 - 9E68 - 48C2 - B4F0 - D7DFAC91FEB3, gminplaceedit)
            DATA(std::wstring, MainServiceGuid)
            DATA(std::wstring, MainDocumentPath)
            DATA(std::wstring, EditFamilyFilePath)
            DATA(std::wstring, FamilyName)
        DBOBJECT_DATA_END

    public:
        const std::wstring& GetMainServiceGuid() const { return this->GetMainServiceGuid__(); }
        bool SetMainServiceGuid(const std::wstring& connectionGuid) { this->SetMainServiceGuid__(connectionGuid); return true; }
        const std::wstring& GetMainDocumentPath() const { return this->GetMainDocumentPath__(); }
        bool SetMainDocumentPath(const std::wstring& mainDocumentPath) { this->SetMainDocumentPath__(mainDocumentPath); return true; }
        const std::wstring& GetEditFamilyFilePath() const { return this->GetEditFamilyFilePath__(); }
        bool SetEditFamilyFilePath(const std::wstring& familyFilePath) { this->SetEditFamilyFilePath__(familyFilePath); return true; }
        const std::wstring& GetFamilyName() const { return this->GetFamilyName__(); }
        bool SetFamilyName(const std::wstring& familyName) { this->SetFamilyName__(familyName); return true; }

    };

    // 编辑族共享数据
    class GM_INPLACE_EDIT_EXPORT LoadFamilyToProjectSharedContent : public RpcSharedObject
    {
        DBOBJECT_DATA_BEGIN(gcmp, LoadFamilyToProjectSharedContent, gcmp::RpcSharedObject, DDB63CEE - 12FA - 4FB3 - A317 - 0B7F8E4E6FA7, gminplaceedit)
            DATA(std::wstring, MainServiceGuid)
            DATA(std::wstring, FamilyServiceGuid)
            DATA(UInt16, RequestPort)
            MAP_DATA(std::wstring, std::wstring, MainDocumentPathToNameMap)
            DATA(Bool, IsCloseFamilyDocument)
        DBOBJECT_DATA_END

    public:
        const std::wstring& GetMainServiceGuid() const { return this->GetMainServiceGuid__(); }
        bool SetMainServiceGuid(const std::wstring& connectionGuid) { this->SetMainServiceGuid__(connectionGuid); return true; }
        const std::wstring& GetFamilyServiceGuid() const { return this->GetFamilyServiceGuid__(); }
        bool SetFamilyServiceGuid(const std::wstring& connectionGuid) { this->SetFamilyServiceGuid__(connectionGuid); return true; }
        const bool GetIsCloseFamilyDocument() const { return this->GetIsCloseFamilyDocument__(); }
        bool SetIsCloseFamilyDocument(bool isCloseFamilyDocument) { this->SetIsCloseFamilyDocument__(isCloseFamilyDocument); return true; }

        UInt16 GetRequestPort() const { return this->GetRequestPort__(); }
        bool SetRequestPort(UInt16 requestPort) { this->SetRequestPort__(requestPort); return true; }
        const std::map<std::wstring, std::wstring>& GetMainDocumentPathToNameMap() const { return this->GetMainDocumentPathToNameMap__(); }
        bool AddMainDocumentPathToNameMap(const std::wstring& mainDocumentPath, const std::wstring& documentName);
        void ClearMainDocumentPathToNameMap();
    };

}// namespace gcmp
